package com.sxhuayuan.parking.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.cache.annotation.CacheEvict;
import org.springframework.stereotype.Service;

import com.sxhuayuan.parking.dao.BaseDao;
import com.sxhuayuan.parking.dao.SettingsDao;
import com.sxhuayuan.parking.entity.Settings;
import com.sxhuayuan.parking.service.SettingsService;

@Service("settingsServiceImpl")
public class SettingsServiceImpl extends BaseServiceImpl<Settings, Long> implements SettingsService {

	@Autowired
	SettingsDao dao;

	@Override
	public BaseDao<Settings, Long> getDAO() {
		return dao;
	}

	@Override
	@CacheEvict(value = "setting", allEntries = true)
	public void save(Settings entity) {
		super.save(entity);
	}

	@Override
	@CacheEvict(value = "setting", allEntries = true)
	public void save(String name, String value) {
		dao.save(name, value);
	}

	@Override
	public void saveAll(List<Settings> set) {
		dao.saveAll(set);
	}

	@Override
	@CacheEvict(value = "setting", allEntries = true)
	public Settings update(Settings entity) {
		return super.update(entity);
	}

	@Override
	@CacheEvict(value = "setting", allEntries = true)
	public void delete(Long id) {
		super.delete(id);
	}
}
